﻿using Iworld.Author.Model;
using Iworld.basis.Service;
using Iworld.Basis.Manager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Iworld.Author.Service.Backstage.Import
{
    /// <summary>
    /// 移除用户数据集
    /// </summary>
    [DataContract]
    public class RemoveUserImport : CheckAdministratorImportBase, IPackageForRemoveModel<IModelToDbContextOfAuthor>
    {
        [DataMember]
        public int UserId { set; get; }

        public int Id
        {
            get { return UserId; }
        }


        public override void CheckAllowExecuteOrNot(Main.Impl.ModelToDbContext db)
        {
            base.CheckAllowExecuteOrNot(db);
            if (!Self.Group.CanEditUser)
            {
                throw new Exception("你无权删除用户");
            }
        }

        public void CheckData(IModelToDbContextOfAuthor db)
        {
            
        }
    }
}
